package com.zhouchb.stream;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;

/**
 * @Author Zhouchb
 * @Create 2021-11-2021/11/1 :20:00
 * @Description
 */
public class PrintStreamTest {
    public static void main(String[] args) {
        PrintStream ps = null;
        try {
            ps = null;
            FileOutputStream fos = new FileOutputStream("IO/text.txt");
            ps = new PrintStream(fos,true);
            System.setOut(ps);
            for (int i=0;i<255;i++){
                System.out.print((char)i);
                if (i%50==0){
                    System.out.println();
                }
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } finally {
            if (ps!=null)
            ps.close();
        }
    }
}
